<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>
        住院登记
    </title>
    <style>
        body {
            /*background-color: #f9f9f9;*/
            padding-botton: 50px;
        }

        .zhuyuan {
            /*border: 1px red solid;*/
            padding-left: 50px;
        }

        .topTitle {
            font-size: 20px;
            line-height: 50px;
            text-align: center;
        }

        .xiangqing span {
            margin-left: 20px;
            line-height: 30px
        }
    </style>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../css/x-admin.css" media="all">
    <link rel="stylesheet" href="../css/pag.css" media="all">
</head>
<body>
<div class="x-nav">
            <span class="layui-breadcrumb">
              <a><cite>住院管理</cite></a>
              <a><cite>病人查询</cite></a>
              <a><cite>病人详情</cite></a>
            </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
       href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon"
                                                                        style="line-height:30px">ဂ</i></a>
</div>
<div class="doRecord">
    <div class="topTitle">
        <strong>住院病人详情</strong>
    </div>
    <input type="hidden" name="userId" value="${patient.userId}">
    <div>
        <div class="x-body">
            <table class="tablelist" style="width: 500px" align="center">
                <thead>
                <tr>
                    <th>住&nbsp;&nbsp;院&nbsp;&nbsp;号：</th>
                    <th>${patient.userId}</th>
                </tr>
                <tr>
                    <th>姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名：</th>
                    <th>${patient.userName}</th>
                </tr>
                <th>性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别：</th>
                <th>
                    <c:if test="${patient.sex eq 1}">男</c:if>
                    <c:if test="${patient.sex eq 2}">女</c:if>
                    </th>
                </tr>
                <tr>
                    <th>年&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;龄：</th>
                    <th>${patient.age}</th>
                </tr>
                <tr>
                    <th>所属科室：</th>
                    <th>${patient.zkName}</th>
                </tr>
                <tr>
                    <th>床&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号：</th>
                    <th>${patient.bNo}</th>
                </tr>
                <tr>
                    <th>紧急联系人：</th>
                    <th>${patient.contacts}</th>
                </tr>
                <tr>
                    <th>联系电话：</th>
                    <th>${patient.iphone}</th>
                </tr>
                <tr>
                    <th>家庭地址：</th>
                    <th>${patient.address}</th>
                </tr>
                <tr>
                    <th>主治医师：</th>
                    <th>${patient.zdName}</th>
                </tr>
                <tr>
                    <th>入院时间：</th>
                    <th><fmt:formatDate value="${patient.checkInTime}" pattern="YYYY-MM-dd HH:mm:ss"/>
                    </th>
                </tr>
                <tr>
                    <th>病情概要：</th>
                    <th>${patient.summary}</th>
                </tr>
                </thead>
            </table>
        </div>
        <div class="x-body">
            <div class="topTitle">
                <strong>医嘱单</strong>
            </div>
            <div class="tools">
                <ul class="toolbar">
                    <li onclick="tianjiayizhu(${patient.userId})"><span><img src="../images/t01.png"/></span>添加医嘱</li>
                </ul>
                <span class="x-right" style="line-height:25px" align="left">共${totalCount}条记录&nbsp;&nbsp;&nbsp;&nbsp;第${currentPageNo}页/共${totalPageCount}页</span></xblock>
            </div>
                <table class="tablelist">
                    <thead>
                    <tr>
                        <th>日期</th>
                        <th>时间</th>
                        <th>医嘱内容</th>
                        <th>医嘱医师</th>
                        <th>执行医师</th>
                        <th>执行时间</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach var="yz" items="${zuyuanyzs}">
                        <tr>
                            <td><fmt:formatDate value="${yz.ZDate}" pattern="YYYY-MM-dd"/> </td>
                            <td><fmt:formatDate value="${yz.ZTime}" pattern="hh:mm"/> </td>
                            <td>${yz.zsummary}</td>
                            <td>${yz.ydName}</td>
                            <td>${yz.yzxName}</td>
                            <td><fmt:formatDate value="${yz.doTime}" pattern="hh:mm"/></td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
            <div class="page" v-show="show" >
                <div class="pagelist">
                    <input type="hidden" name="currentPageNo" id="currentPageNo" value="${currentPageNo}"/>
                    <input type="hidden" name="totalPageCount" id="totalPageCount" value="${totalPageCount}"/>
                    <span class="jump"><a href="javascript:page_nav(${patient.userId},1);"> 首页</a></span>
                    <span class="jump"><a href="javascript:page_nav(${patient.userId},${currentPageNo - 1 });">上一页</a></span>
                    <span class="jump"><a href="javascript:page_nav(${patient.userId},${currentPageNo + 1 });">下一页</a></span>
                    <span class="jump"><a href="javascript:page_nav(${patient.userId},${totalPageCount });">尾页</a></span>
                    <span class="jumppoint">跳转到：</span>
                    <span class="jumpinp"><input type="text" name="inputPage" id="inputPage"/></span>
                    <button type="button" class="jump gobtn" onClick='jump_to(${patient.userId},document.getElementById("inputPage").value)'>GO</button>
                    </span>
                </div>
                <div>
            </div>
        </div>

        <div class="providerAddBtn" align="center" style="padding-bottom: 40px">
            <span><button class="layui-btn" lay-submit=""><a href="javascript:history.go(-1);"
                                                             style="color: #fff">返回</a></button></span>
        </div>

</div>

</body>

<script src="../lib/layui/layui.js" charset="utf-8"></script>
<script src="../lib/layui/layui.all.js" charset="utf-8"></script>
<script src="../js/x-layui.js" charset="utf-8"></script>
<script src="../js/jquery2.js" charset="utf-8"></script>
<script src="../js/js.js" charset="utf-8"></script>
<script>
    layui.use(['laydate', 'element', 'laypage', 'layer'], function () {
        $ = layui.jquery;//jquery
        lement = layui.element();//面包导航
        laypage = layui.laypage;//分页
        layer = layui.layer;//弹出层
    });

    function tianjiayizhu(userId) {
        layer.open({
            type: 2,
            area: ['550px', '350px'],
            fix: false, //不固定
            maxmin: true,
            shadeClose: true,
            shade: 0.4,
            title: '确认医嘱',
            content: '/tjyz/' + userId,
            end:function () {

                window.location.reload();
            }
        });
    }
    function page_nav(userId,page) {
        window.location.href ="${pageContext.request.contextPath}/brck?userId="+userId+"&currentPageNo="+page;
    }
    function jump_to(userId,page) {
        var regx = /^\d{1,}$/;
        if (!regx.test(page)){
            layer.alert("请输入正确数字",{icon: 6});
            return;
        }
        var totalPageCount = document.getElementById("totalPageCount").value;
        if(page <= 0 || page > totalPageCount){//在首页和最后一页之间
            layer.alert("请输入正确的页码!",{icon: 6});
            return;
        }
        window.location.href ="${pageContext.request.contextPath}/brck?userId="+userId+"&currentPageNo="+page;
    }
</script>
<script>
    $('.tablelist tbody tr:odd').css("background-color","#f5f8fa");
</script>
</html>